package cn.com.dcsgo.pojo;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Past;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

/**
 * User
 * 在需要效验的实体属性上添加需要的效验注解
 * 前提是导入了相关依赖
 *
 * @author Dcsgo
 * @since 2025/3/5 10:45
 */
@Data
public class User {
    @NotBlank
    private String name;
    @Length(min = 6, max = 16)
    private String password;
    @Min(1)
    private Integer age;
    @Email
    private String email;
    @Past
    private Date birthday;
}
